Music player applicable to portable telephone terminal

ABSTRACT

A music playback device applicable to a portable telephone terminal device uses a sequence data FIFO memory and a waveform data FIFO memory both having limited storage capacities. A system CPU performs successive transfer of sequence data and waveform data in response to shortage events of the memories. Hence, it is possible to actualize high-quality playback of musical tunes with small storage capacities of the memories and with small load of processing of the system CPU.

TECHNICAL FIELD

This invention relates to music playback devices that are applicable toportable telephone terminals such as automobile phones and cellularphones.

BACKGROUND ART

Conventionally, there are provided digital cellular systems such as PDC(Personal Digital Cellular telecommunication system) and PHS (PersonalHandyphone System). Upon receipt of incoming calls, portable telephoneterminals such as cellular phones held by users produce incoming callsounds to notify users of reception of incoming calls. As incoming callsounds, telephone terminal devices conventionally produce beep sounds,which are offensive to ears of users. Recently, telephone terminaldevices produce melody sounds as incoming call sounds instead of theconventional beep sounds.

The aforementioned telephone terminal devices are capable of producingmelody sounds, however, which are not satisfactory in sound quality.

In order to improve the sound quality, music playback devices thatreproduce music data representing musical tunes on telephone terminaldevices are provided. A typical example of a music playback device foruse in a telephone terminal device is constituted by a centralprocessing unit (CPU), a read-only memory (ROM), a random-access memory(RAM), and a sound source. Herein, the CPU runs automatic performanceprograms stored in the ROM, so that music data stored in the ROM or RAMare read, and tone-generation parameters are set to the sound source.Thus, musical tunes are played back on the telephone terminal device.

It is required that telephone terminal devices, particularly portabletelephones sold in the market, are reduced in size and price and aredesigned to have multiple functions. In addition, it is required thattelephone terminal devices are capable of performing numerous functionssuch as call transmission and reception functions, display function,etc. In the music playback device incorporated into the portabletelephone terminal device, the CPU should perform music playbackprocesses in addition to telephone function processes. Hence, the musicplayback device requires a high-speed CPU for processing. This raises aproblem in that the portable telephone terminal device having ahigh-speed CPU must be expensive.

Melody ICs are known as devices that are exclusively designed toreproduce melodies. A typical example of a melody IC for use in aportable telephone terminal device is constituted by a sound source, asequencer, and a ROM that is exclusively used as a music data storage.By applying music playback instructions from the external device, themelody IC reproduces music data stored in the ROM to play back a melodyof a musical tune. By incorporating such a melody IC into the portabletelephone terminal device, the CPU does not necessarily perform musicplayback processes. Using the melody IC eliminates the necessity thatthe CPU executes music playback processes. Hence, it is possible to usea low-cost and low-speed CPU for the portable telephone terminal deviceincorporating the melody IC.

Normally, the melody IC provides a ROM having a small storage capacityfor music data, hence, the melody IC is capable of storing the limitednumber of musical tunes, so it is impossible to increase time lengthsfor playback of musical tunes. Because of the small storage capacity ofthe ROM, the melody IC cannot store the considerable amount of musicdata realizing high-quality playback of musical tunes. Hence, theportable telephone terminal device incorporating the melody IC playsback only a melody of low sound quality.

It is an object of the present invention to provide a music playbackdevice that is capable of reproducing musical tunes in high soundquality on the basis of music data stored in the limited storagecapacity by using a low-speed operational processor. In addition, it isanother object of the present invention to provide a portable telephoneterminal device incorporating a music playback device realizinghigh-quality playback of musical tunes by using the limited storagecapacity for music data and by using a low-speed operational processor.

DISCLOSURE OF INVENTION

A portable telephone terminal device such as a cellular phone has amusic playback device to play back musical tunes for prescribed uses,namely incoming call notification, hold sound generation, BGM playback,and music playback. The music playback device basically comprises asequence data FIFO memory for storing sequence data containing durationdata and note data with respect to a musical tune, a waveform data FIFOmemory for storing waveform data representing samples of musical tonewaveforms that are made by compressive coding, a decoder for decodingwaveform data to reproduce musical tone signals, and a sequencer forcontrolling the decoder to reproduce musical tone signals in conformitywith the musical tune on the basis of the sequence data. The durationdata represents a time interval that elapses before the start timing ofnote data.

When the sequence data FIFO memory runs short of sequence data inprogression of reproduction of a musical tune, it issues a sequence datatransfer request (S-IRQ) to a system CPU and urges it to transfer thenext portion of sequence data thereto. When the waveform data FIFOmemory runs short of waveform data in progression of reproduction of amusical tune, it issues a waveform data transfer request (W-IRQ) to thesystem CPU and urges it to transfer the next portion of waveform datathereto. Thus, the system CPU successively transfers sequence data tothe sequence data FIFO memory to fill its storage capacity, and it alsosuccessively transfers waveform data to the waveform data FIFO memory tofill its storage capacity. This brings reduction of storage capacitiesfor memories while securing high-quality playback of musical tunes. Inaddition, the system CPU bears merely a small load of processing inexecution of music playback processes, so a high-speed CPU is notnecessarily needed for the system CPU.

Incidentally, it is possible to provide multiple waveform data FIFOmemories with respect to multiple channels, so that the decodersimultaneously reproduces musical tone signals of multiple channels intime division multiplexing.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram showing the electric configuration of aportale telephone having a music playback device in accordance with apreferred embodiment of the invention;

FIG. 2 is a conceptual system diagram showing connections forcommunications of portable telephones via telephone lines;

FIG. 3 is a block diagram showing electric configurations of selectedparts of a portable telephone, particularly internal parts of a musicplayback section in accordance with a first embodiment of the invention;

FIG. 4 is a block diagram showing electric configurations of selectedparts of a portable telephone, particularly internal parts of a musicplayback section in accordance with a second embodiment of theinvention;

FIG. 5 shows an example of the format for use in sequence data stored ina sequence data FIFO memory shown in FIG. 3;

FIG. 6A is a time chart showing a first example of the time relationshipbetween duration data and note data with respect to a single channel;

FIG. 6B is a time chart showing a second example of the timerelationships between duration data and note data with respect tomultiple channels;

FIG. 7 shows a map of a system RAM for storing sequence data andwaveform data;

FIG. 8 is a flowchart showing a main process for assisting musicplayback processes of the music playback section; and

FIG. 9 is a flowchart showing an IRQ process for assisting musicplayback processes of the music playback section.

BEST MODE FOR CARRYING OUT THE INVENTION

This invention will be described in further detail by way of exampleswith reference to the accompanying drawings.

FIG. 1 shows the electric configuration of a portable telephoneincorporating a music playback device in accordance with the preferredembodiment of the invention. That is, a portable telephone 1 has aretractable antenna 1 a coupled with a communicator 13 havingmodulation-demodulation functions. A system CPU 10 performs overallcontrols on various sections or blocks of the system of the cellularphone 1 by running telephone function programs. In addition, the systemCPU 10 has a timer (not shown) that indicates a lapse of time duringoperations and that issues timer interruption by each specific timeinterval. Upon receipt of interrupt request signals (IRQ), the systemCPU 10 performs transfer processes of music data and waveform data forassisting music playback processes, details of which will be describedlater. A system RAM 11 has a storage area for storing music data andwaveform data, which are downloaded from a download center, a user setupdata storage area, and a work area used for the purpose of theprocessing of the system CPU 10. A system ROM 12 stores varioustelephone function programs such as transmission and reception of callsexecuted by the system CPU 10 as well as programs implementing processesfor assisting the aforementioned music playback processes. In addition,the system ROM 12 also stores various types of data such as preset musicdata and waveform data.

The communicator 13 demodulates incoming signals received by the antenna1 a, and it also modulates outgoing signals to be transmitted via theantenna 1 a. That is, the communicator 13 demodulates incoming callsignals to produce received speech signals representing the speech of acalling party transmitted thereto. The received speech signals aredecoded by a speech processor (coder-decoder) 14. In addition, thespeech processor 14 performs compressive coding on transmitting speechsignals representing the speech of the user of the portable telephone 1.That is, the speech processor 14 is designed to perform high-efficiencycompressive coding/decoding on speech signals, for example, the speechprocessor 14 is constituted as a coder-decoder based on the code excitedlinear predictive coding (CELPC) system or adaptive differentialpulse-code modulation (ADPCM) system. A music playback section 15realizing the music playback device of the present invention is coupledwith a speaker 22 to produce the received speech of received speechsignals given from the speech processor 14. In addition, the musicplayback section 15 reproduces music data to produce incoming call soundor hold sound. The incoming call sound is produced by a speaker 23,while the hold sound is mixed together with the received speech and isproduced by the speaker 22.

The music playback section 15 contains a music data storage having asmall storage capacity, and a waveform data storage. During reproductionof music data by the music playback section 15, a vacant area having aprescribed size is produced inside of the music data storage and/or thewaveform data storage. In that case, the music playback section 15issues an interrupt request signal (IRQ) to the system CPU 10, which inturn accesses the system RAM 11 or system ROM 12 to read the nextportion of music data and/or waveform data. Thus, the next portion ofmusic data and/or waveform data is transferred to the music playbacksection 15. An interface (I/F) 16 is used to download from an externaldevice 20 such as a personal computer the music data and/or waveformdata, which are transferred to the system RAM 11. An operator inputsection 17 contains various types of buttons such as function buttonsand dial buttons designating numerals ranging from ‘0’ to ‘9’. A display18 displays on the screen a telephone function menu and various types ofcharacters and/or images in response to operations of buttons on theoperator input section 17. In response to an incoming call, the systemCPU 10 activates the vibrator 19 to generate vibration, which issubstituted for incoming call sound. Due to the activation of thevibrator 19, the body of the portable telephone 1 is vibrated to notifythe user of reception of an incoming call. All of function blocks of theportable telephone 1 are interconnected together by way of a bus 24 tosend or receive instructions and data.

The portable telephone 1 has capabilities of downloading music data andwaveform data via telephone lines or various types of networks. Next,procedures and operations for downloading music data will be describedwith reference to FIG. 2, wherein portable telephones 1 and 101 eachhaving a music playback device are connected with telephone linenetworks.

In general, cellular systems provided for communications of portabletelephones employ small zone systems, wherein numerous radiocommunication zones are arranged in service areas. In FIG. 2, there areprovided four base stations 2 a to 2 d that cover and manage radiocommunication zones respectively. Specifically, FIG. 2 shows that thebase station 2 c manages a radio communication zone to which theportable telephones 1 and 101 corresponding to mobile stations belong.To realize communications with general telephone terminal devices, theportable telephones 1 and 101 are connected via the base station 2 c toa mobile exchange 3, from which they are further connected with generaltelephone networks. Thus, the portable telephones 1 and 101 areconnected with the base station managing the radio communication zone byway of radio communication lines, hence, the users of the portabletelephones 1 and 101 are able to make communications with othertelephone terminal devices.

Next, a detailed description will be given with respect to an example ofthe cellular system shown in FIG. 2, wherein the portable telephones 1and 101 belong to the same radio communication zone managed by the basestation 2 c within the four base stations 2 a-2 d. The portabletelephones 1 and 101 are connected with the base station 2 c by radiocommunication lines, so that uplink signals for use in conversation andregistration of location are received and processed by the base station2 c. The base stations 2 a-2 d manage different radio communicationzones, which may adjoin with each other. It is possible to control theoutput powers of the base stations 2 a-2 d such that the peripheralportions of the radio communication zones mutually and partially overlapwith each other. The base stations 2 a-2 d are connected with the mobileexchange 3 by way of multiplexed lines. FIG. 2 shows a single mobileexchange 3 and a single gate exchange 4 only for the simplification ofillustration, however, there may be provided plural mobile exchangeswhose lines are concentrated on plural gate exchanges, which may beconnected with a general telephone exchange 5 a. The gate exchanges aremutually connected with each other by trunk transmission lines. Generaltelephone exchanges 5 a, 5 b, 5 c are arranged in service areasrespectively, wherein they are mutually connected with each other by wayof trunk transmission lines. Each of the general telephone exchanges 5a-5 c is connected with numerous general telephones. The generaltelephone exchange 5 b is connected with a download center 6.

The download center 6 corresponds to computer facilities used for thepurpose of the distribution of music data and information to generaltelephone terminals or other communication devices. That is, thedownload center 6 accumulates at all the times numerous music data andwaveform data, which are updated by additions of new musical tunes atany time. The present system allows the users of the portable telephones1 and 101 to download music data and waveform data from the downloadcenter 6 connected with general telephone networks. In order to downloadmusic data from the download center 6, the user of the portabletelephone 1 designates a prescribed telephone number to call thedownload center 6. Thus, there is established a communication pathbetween the portable telephone 1, base station 2 c, mobile exchange 3,gate exchange 4, general telephone exchanges 5 a and 5 b, and downloadcenter 6. Then, the prescribed musical tune selection menu is displayedon the screen of the display 18 of the portable telephone 1, accordingto which the user operates dial buttons on the operator input section 17to select a desired musical tune (or desired musical tunes). Thus, theuser is able to download music data of the desired musical tune(s) ontothe portable telephone 1 from the download center 6. Similarly, the useris also able to download desired waveform data onto the portabletelephone 1 from the download center 6.

FIG. 3 shows the electric configuration of the music playback section 15corresponding to a music playback device in accordance with the firstembodiment of the invention.

The music playback section 15 of FIG. 3 comprises a CPU interface (CPUI/F) 30, first registers 31, a sequence data FIFO memory 32, a waveformdata FIFO memory 33, a sequencer 34, second registers (REG) 35, adecoder 36, a digital-to-analog converter (DAC) 37, a mixer 38, and anIRQ control section 39. Herein, ‘FIFO’ is an abbreviation for‘First-In-First-Out’ in which data input first are output first.

The CPU interface 30 is connected to the system CPU 10 by way of an8-bit data line (Data/Index), a chip select line (CS), an addresscontrol line (A0), a read control line (RD), and a write control line(WR). The address control line is used to designate whether signals onthe data line represent data or indexes. Indexes are used to designateaddresses of registers contained in the first registers 31 and thesecond registers 35 respectively. By sequentially writing data andindexes to the CPU interface 30 via the data line, it is possible towrite data to registers that are designated by indexes within the firstregisters 31 and second registers 35. In this case, signals of theaddress line designate distinctions between signals of the data line. Ina read mode, indexes are written to the CPU interface 30 via the dataline, then, read instructions are applied to the CPU interface 30 viathe read control line. Thus, it is possible to read data from registersthat are designated by indexes within the first registers 31 and secondregisters 35.

The first registers 31 contain five registers, each of which stores8-bit data. The five registers are given prescribed names, that is, asequencer control register, a sequence data register, a waveform dataregister, a status register, and a waveform number register.

The system CPU 10 writes sequencer control data to the sequencer controlregister to control the sequencer 34. The sequencer control data maycontain a sequencer start instruction for starting playback of musicaltones and/or a sequencer stop instruction for stopping playback ofmusical tones.

The system CPU 10 writes sequence data such as music data to thesequence data register. The sequence data are formed in the prescribedformat, which will be described later. As shown in FIG. 5, music data ofa single musical tune are constituted by alternately arranging durationdata and note data, wherein the duration data represent time intervalsbetween tone-generation timings of musical tones, and the note datacorrespond to tone-generation data. The sequence data written into thesequence data register are directly and immediately transferred to thesequence data FIFO memory 32.

The system CPU 10 writes waveform data to the waveform data register,from which waveform data are directly and immediately transferred to thewaveform data FIFO memory 33. Details of waveform data will be describedlater. Roughly speaking, waveform data are made by performing codingoperations or compressive coding operations on waveform amplitudevalues, which are extracted by sampling vocal sound, speech, and musicaltones produced by actually playing musical instruments.

The status register represents music playback states (or statuses) ofthe music playback section 15. The status register stores a sequencedata Full flag (S-Full) and a sequence data IRQ flag (S-IRQ) from thesequence data FIFO memory 32 as well as a waveform data Full flag(W-Full) and a waveform data IRQ flag (W-IRQ) from the waveform dataFIFO memory 33. In addition, it also stores a sequence data END flag(END) and a gate time END flag (GEND) from the sequencer 34. The contentof the status register is read by the system CPU 10.

The waveform number register stores waveform numbers that designatewaveform data to be reproduced. The content of the waveform numberregister is read by the system CPU 10. Incidentally, the sequencer 34extracts waveform numbers (WAVE-No) from the note data, so that the readwaveform numbers are supplied to the first registers 31.

The sequence data FIFO memory 32 has a storage capacity of thirty-twobytes (i.e., 32×8 bits), for example. In a write mode, the system CPU 10sequentially writes sequence data, which correspond to a selectedmusical tune, to the sequence data FIFO memory 32 by way of the sequencedata register within the first registers 31. In a read mode, thesequence data are sequentially read from the sequencer 34 in conformitywith a write order. Once the sequence data are read by the sequencer 34,they are discarded in the sequence data FIFO memory 32. In addition tothe aforementioned FIFO functions, the sequence data FIFO memory 32 hasfunctions of monitoring amounts of sequence data stored therein. In thefull condition where the amount of sequence data stored in the sequencedata FIFO memory 32 reaches thirty-two bytes, the sequence data FIFOmemory 32 issues a sequence data Full flag (S-Full) and sets it to thestatus register of the first registers 31. In the shortage conditionwhere the amount of sequence data stored in the sequence data FIFOmemory 32 decreases under the prescribed amount (e.g., eight bytes) thatis preset by the system CPU 10, the sequence data FIFO memory 32 issuesa sequence data IRQ flag (S-IRQ) and sets it to the status register ofthe first registers 31. The sequence data IRQ flag is also supplied tothe IRQ control section 39 to notify the system CPU 10 of the shortagecondition of the sequence data FIFO memory 32.

The waveform data FIFO memory 33 has a storage capacity of 384 bytes(i.e., 384×8 bits), for example. In a write mode, the system CPU 10sequentially writes waveform data to the waveform data FIFO memory 33 byway of the waveform data register within the first registers 31. In aread mode, the waveform data are sequentially read by the sequencer 34or decoder 36. Once the waveform data are read by the sequencer 34 ordecoder 36, they are discarded in the waveform data FIFO memory 33. Thewaveform data are formed in the prescribed format realizing ADPCM (oradaptive differential pulse-code modulated) waveform data that arecreated based on PCM (or pulse-code modulated) waveform data consistingof 16-bit samples, for example. That is, the PCM waveform data arecompressed by an ADPCM encoder to the ADPCM waveform data consisting of4-bit samples. FIG. 7 shows an example of waveform data, wherein‘waveform data 1’ consists of eight bits (or one byte) that contain twosamples of ADPCM waveform data. In addition to the aforementioned FIFOfunctions, the waveform data FIFO memory 33 has functions of monitoringamounts of waveform data stored therein. In the full condition where theamount of waveform data stored in the waveform data FIFO memory 33reaches 384 bytes, the waveform data FIFO memory 33 issues a waveformdata Full flag (W-Full) and sets it to the status register of the firstregisters 31. In the shortage condition where the amount of the waveformdata decreases under the prescribed amount (e.g., 128 bytes) that ispreset by the system CPU 10, the waveform data FIFO memory 33 issues awaveform data IRQ flag (W-IRQ) and sets it to the status register of thefirst registers 31. The waveform data IRQ flag is also supplied to theIRQ control section 39 to notify the system CPU 10 of the shortagecondition of the waveform data FIFO memory 33.

By writing a sequencer start instruction to the sequencer controlregister of the first registers 31, the sequencer 34 starts to operatein accordance with the sequencer start instruction. Prior to thesequencer start instruction, it is necessary that some amount ofsequence data is precedently written to the sequence data FIFO memory32. It is preferable that at least the head portion of waveform datadesignated by the sequence data is precedently written to the waveformdata FIFO memory 33.

Outline operations of the sequencer 34 will be described below.

-   -   (1) The sequencer 34 inputs a head portion of sequence data        consisting of duration data and note data, which are stored in        the sequence data FIFO memory 32.    -   (2) A waveform number contained in note data 1 is written to the        waveform number register of the first registers 31.    -   (3) If the corresponding waveform data are not precedently        written to the waveform data FIFO memory 33, the waveform data        FIFO memory 33 immediately issues a waveform data IRQ flag        (W-IRQ), which is forwarded to the system CPU 10 via the IRQ        control section 39. Thus, the system CPU 10 refers to the status        register of the first registers 31 to recognize that the        waveform data IRQ flag is caused by a shortage of waveform data        in the waveform data FIFO memory 33. The system CPU 10        immediately proceeds to transfer of waveform data. In order to        specify the transferring waveform data, the system CPU 10 refers        to the waveform number written to the waveform number register        of the first registers 31. Alternatively, the system CPU 10        specifies the waveform number based on the sequence data of the        selected musical tune stored in the system RAM 11. Thereafter,        the system CPU 10 manages how much the waveform data designated        by the waveform number are to be transferred to the waveform        data FIFO memory 33.    -   (4) After the waveform data are completely accumulated in the        waveform data FIFO memory 33, the sequencer 34 waits for a        prescribed time designated by duration data 1, then, it        instructs the decoder 36 to start decoding on the waveform data        corresponding to the note data 1. Concretely speaking, the        sequencer 34 outputs tone-generation parameters containing        start/stop signals, tone volume, etc., so that tone-generation        parameters are written to the second registers (REG) 35        positioned just before the decoder 36. At this timing, the        sequencer 34 inputs duration data 2 and note data 2 to make        preparation for reproduction of the next waveform data. Herein,        the preparation for the reproduction is the time management with        respect to the duration data 2.    -   (5) After a lapse of the gate time contained in the note data 1,        the sequencer 34 instructs the decoder 36 to stop decoding. In        addition, the reproduced duration data and note data are cleared        in the waveform data FIFO memory 33. Further, the sequencer 34        issues a gate time END flag (GEND) and sets it to the status        register of the first registers 31. In the present embodiment,        the system CPU 10 refers to the gate time END flag to        immediately stop transferring the waveform data to the waveform        data FIFO memory 33. Thus, it is possible to avoid unnecessary        transfer of the waveform data, which are not needed for        generation of musical tones, to the waveform data FIFO memory        33.    -   (6) Similar tone-generation processes are performed with respect        to the note data 2. The tone-generation processes are        continuously performed with respect to the waveform data towards        an end of the sequence data. When detecting an end of the        sequence data, the sequencer 34 and decoder 36 stop operations        thereof. In addition, all data are cleared in the sequence data        FIFO memory 32 and the waveform data FIFO memory 33. The        sequencer 34 issues a sequence data END flag (END) and sets it        to the status register of the first registers 31. With reference        to the sequence data END flag, the system CPU 10 makes        preparation for reproduction of the next sequence data.

When the sequencer 34 writes tone-generation parameters such asstart/stop signals and tone volume to the second registers 35, thedecoder 36 starts or stops decoding operations thereof Based ontone-generation parameters from the sequencer 34 and the waveform datafrom the waveform data FIFO memory 33, the decoder 36 decodes (orexpands) ADPCM waveform data consisting of 4-bit samples to produce PCMwaveform data consisting of 16-bit samples. The format of the waveformdata is not necessarily limited to the ADPCM format, so it is possibleto employ other types of formats that allow compression of waveformdata, such as the DPCM (Differential Pulse-Code Modulation) format, MP3(namely, Moving Picture Experts Group, audio layer 3) format, and TwinVQ(registered trademark) format. If the present embodiment is redesignedto use one of the aforementioned formats, the decoder 36 should becorrespondingly reconstructed to cope with one of them. If the presentembodiment is redesigned to reproduce waveform data of thenon-compressed PCM format, it is necessary to skip decoding process ofthe decoder 36.

The music playback section 15 shown in FIG. 3 is originally designedsuch that the sequencer 34 is used to reproduce waveform data. Insteadof using the sequencer 34, the music playback section 15 operates suchthat the system CPU 10 directly writes tone-generation parameters to thesecond registers 35 by means of the CPU interface 30 via a line named‘Direct Data’. Thus, it is possible to actualize real-timetone-generation functions of musical tones. In this case, the decoder 36is also activated to decode waveform data from the waveform data FIFOmemory 33. That is, it is necessary to supply and fill the waveform dataFIFO memory 33 with waveform data. The music playback section 15 isinstalled in the portable telephone 1 (or 101) having game functions,for example. Due to real-time tone-generation functions of the musicplayback section 15, the portable telephone 1 can smoothly generateeffective sounds in real time in connection with game events.

The sequence data FIFO memory 32 outputs a sequence data IRQ flag(S-IRQ) to notify the IRQ control section 39 that the amount of sequencedata remained in the sequence data FIFO memory 32 decreases under theprescribed amount. Alternatively, the waveform data FIFO memory 33outputs a waveform data IRQ flag (W-IRQ) to notify the IRQ controlsection 39 that the amount of waveform data remained in the waveformdata FIFO memory 33 becomes lower than the prescribed amount. Uponreceipt of the sequence data IRQ flag and/or the waveform data IRQ flag,the IRQ control section 39 issues an IRQ signal to the system CPU 10.Upon receipt of the IRQ signal, the system CPU 10 refers to the sequencedata IRQ flag and/or the waveform data IRQ flag stored in the statusregister of the first registers 31, so that the system CPU 10 examinesthe cause of the IRQ to perform corresponding processes. Due to thesetting of the sequence data IRQ flag, the system CPU 10 detects thatthe sequence data FIFO memory 32 runs short of the sequence data, sothat the system CPU 10 proceeds to transfer of a certain amount ofsequence data, which are 24 bytes (=32 bytes−8 bytes). The followingportion of the sequence data is read from the system RAM 11 or systemROM 12, and are then transferred to the sequence data FIFO memory 32.

Due to the setting of the waveform data IRQ flag, the system CPU 10detects that the waveform data FIFO memory 33 runs short of the waveformdata, so that the system CPU 10 proceeds to transfer of a certain amountof waveform data, which are 256 bytes (=384 bytes−128 bytes). Thefollowing portion of the waveform data is read from the system RAM 11 orsystem ROM 12, and are then transferred to the waveform data FIFO memory33. Incidentally, the system CPU 10 is not required to immediatelyperform transfer of the sequence data of 24 bytes and/or transfer of thewaveform data of 256 bytes. In addition, the system CPU 10 is notrequired to transfer the sequence data of 24 bytes and/or the waveformdata of 256 bytes entirely. That is, the transferring of the sequencedata and/or waveform data is performed at the timing and by the amount,in which the music playback section 15 can continuously reproducemusical tones without interruption.

The aforementioned transfer of the sequence data and/or waveform datamay be performed by an interrupt process. It is possible to performtransfer of the sequence data and/or waveform data without the interruptprocess if the system CPU 10 directly accesses the status register ofthe first registers 31 to read the sequence data Full flag, sequencedata IRQ flag, waveform data Full flag, and waveform data IRQ flag inpredetermined periods. In that case, it is possible to exclude the IRQcontrol section 39 from the music playback section 15.

In the music playback section 15 of the first embodiment shown in FIG.3, the sequencer 34 starts playback upon detection of a playback startinstruction that is issued by the system CPU 10. The system CPU 10issues a playback start instruction when the user operates a playbackkey of the portable telephone (1 or 101) to start playback of music orbackground music (BGM), or when the portable telephone receives incomingcall notification to start playback of incoming call sound (or incomingcall melody). Even when the user operates a hold key of the portabletelephone to start playback of hold sound, the system CPU 10 issues aplayback start instruction.

To start playback of musical tones, the sequencer 34 reads a headportion of the sequence data consisting of first note data and firstduration data from the sequence data FIFO memory 32 so that a waveformnumber contained in the first note data is written to the waveformnumber register of the first registers 31. Thus, the waveform datadesignated by the waveform number are written to the waveform data FIFOmemory 33 under the control of the system CPU 10. Thus, the musicplayback section 15 completes preparation for starting playback of amusical tone. At the tone-generation start timing based on the firstduration data, the sequencer 34 controls the decoder 36 to startdecoding on the waveform data. At the same time, the sequencer 34 readsthe next portion of sequence data consisting of next duration data andnext note data from the sequence data FIFO memory 32. By repeating theaforementioned operations, the decoder 36 sequentially decodes thewaveform data to produce PCM waveform data, which are converted toanalog waveform signals by the digital-to-analog converter 37, so thatappropriate sound is reproduced based on analog waveform signals. Whenthe reproduced sound correspond to music or incoming call sound (orincoming call melody), the speaker 23 produces the reproduced sound.When the reproduced sound correspond to BGM or hold sound, thereproduced sound is mixed with received speech signals from the speechprocessor 14 by the mixer 38, so that the mixed sound is produced by thespeaker 22. In the case of the hold sound, received speech signals aremuted in the mixer 38, so that only the hold sound is produced by thespeaker 22.

During the decoding of the first note data, when the amount of waveformdata stored in the waveform data FIFO memory 33 decreases under theprescribed amount (e.g., 128 bytes), the waveform data FIFO memory 33issues a waveform data IRQ flag (W-IRQ), which is set to the statusregister of the first registers 31. The waveform data IRQ flag is alsodelivered to the IRQ control section 39 to notify the system CPU 10 of ashortage event of the waveform data in the waveform data FIFO memory 33.In response to the waveform data IRQ flag, the system CPU 10 writes thenext portion of waveform data to the waveform data FIFO memory 33 by wayof the waveform data register. As a result, even though the waveformdata FIFO memory 33 has a relatively small storage capacity, it ispossible to reproduce numerous waveform data, which are necessary forhigh quality reproduction of musical tones, without interruption.

When it comes to an end time of a tone-generation period based on thegate time of the first note data, the sequencer 34 stops the decoder 36decoding the waveform data, so that the reproduced sound is stopped. Atthe same time, the sequencer 34 sets a gate time END flag (GEND) to thestatus register while it also clears the first duration data and firstnote data in the sequence data FIFO memory 32. Next, the sequencer 34writes a waveform number contained in second note data to the waveformnumber register, so that the system CPU 10 writes waveform datadesignated by the waveform number to the waveform data FIFO memory 33.Then, the sequencer 34 waits for the start timing of a tone-generationperiod based on second duration data. When it comes to the start timingof the tone-generation period, the sequencer 34 controls the decoder 36to start decoding of waveform data based on the second note data. At thesame time, the sequencer 34 reads third duration data and third notedata from the sequence data FIFO memory 32. The aforementionedoperations are repeatedly performed till an end of the sequence data oruntil the user operates an end key of the portable telephone to stopplayback. Until then, the portable telephone continuously producesreproduced sound based on the sequence data.

In the progression of reproduction of the waveform data on the basis ofthe sequence data, when the amount of sequence data stored in thesequence data FIFO memory 32 decreases under the prescribed amount(e.g., 8 bytes), the sequence data FIFO memory 32 issues a sequence dataIRQ flag (S-IRQ), which is set to the status register within the firstregisters 31. At the same time, the sequence data IRQ flag is alsodelivered to the IRQ control section 39 to notify the system CPU 10 of ashortage event of the sequence data in the sequence data FIFO memory 32.In response to the sequence data IRQ flag, the system CPU 10 writes thenext portion of sequence data to the sequence data FIFO memory 32 by wayof the sequence data register. As a result, even though the sequencedata FIFO memory 32 has a relatively small storage capacity, it ispossible to reproduce numerous sequence data, which are required forlong-time reproduction, without interruption.

With reference to FIG. 4, a description will be given with respect tothe electric configuration of a music playback section 15 in accordancewith a second embodiment of the invention.

The music playback section 15 of the second embodiment is designed tosimultaneously reproduce waveform data of four channels based onsequence data of a single musical tune. In this case, sequence data havethe prescribed format that allows simultaneous reproduction of waveformdata of four channels. Thus, the music playback section 15 of the secondembodiment secures simultaneous reproduction of waveform data of fourchannels. Unlike the music playback section 15 of FIG. 3 using a singlewaveform data FIFO memory 33, the music playback section 15 of FIG. 4contains four waveform data FIFO memories 133 a, 133 b, 133 c, and 133 din connection with four channels Ch1, Ch2, Ch3, and Ch4. In addition,the decoder 136 is designed to decode waveform data of four channelsbased on time division multiplexing (TDM).

Next, a description will be given with respect to an example of theformat of sequence data with reference to FIG. 5. Herein, sequence dataconsist of duration data and note data (or tone-generation data), whichare arranged alternately. Duration data consists of one byte or twobytes to represent an interval of time that elapses before start ofreproduced sound corresponding to next note data. Note data consists oftwo bytes, which are constituted by 2-bit channel number (Ch-No)representing one of four tone-generation channels, 6-bit waveform number(WAVE-No) designating one of waveform data within sixty-four tonecolors, and 8-bit gate time. Gate time corresponds to time data thatrepresent a note length of reproduced sound based on note data.

The aforementioned format of sequence data shown in FIG. 5 is not onlyapplied to the music playback section 15 of the second embodiment, whichcan simultaneously reproduce waveform data of four channels, but alsoapplied to the music playback section 15 of the first embodiment, namelya monophonic music playback section in which the number ofsimultaneously reproduced sounds is set to ‘1’. Because the musicplayback section 15 of the first embodiment is designed tosimultaneously reproduce only one sound, it neglects the channel numbercontained in note data.

FIG. 5 shows an example of sequence data that contain note data, whichis constituted by a start and an end of tone generation, and waveformdata corresponding to a musical tone to be generated, as tone-generationdata. Other than note data, it is possible to include description oftone volume data such as volume control in sequence data. In this case,duration data, which are originally provided to represent time intervalsbetween note data, should be modified to represent time intervalsbetween various types of data.

FIGS. 6A and 6B show time relationships between duration data and notedata. That is, FIG. 6A shows a first example of time relationship inwhich duration data represent time intervals between note data withrespect to channel 1 (Ch1), wherein notes are consecutively arrangedwithout being overlapped with each other in the same time line. That is,duration data 1 represents a time interval that elapses before the starttiming of note data 1. Similarly, duration data 2 represents a timeinterval that elapses between start timings of note data 1 and note data2; and duration data 3 represents a time interval that elapses betweenstart timings of note data 2 and note data 3 (not shown).

FIG. 6B shows a second example of time relationship in which durationdata represent time intervals between note data over different channels,wherein notes are arranged and partially overlapped with each otheramong different channels. That is, duration data 1 represents a timeinterval that elapses before the start timing of note data 1 of channel1; duration data 2 represents a time interval that elapses between starttimings of note data 1 of channel 1 and note data 2 of channel 2, whichpartially overlap with each other in a time axis. Similarly, durationdata 3 represents a time interval that elapses between start timings ofnote data 2 of channel 2 and note data 3 of channel 3, which partiallyoverlap with each other in a time axis.

Next, a description will be given with respect to a map of the systemRAM 11 that stores sequence data and waveform data.

The number of musical tunes of sequence data to be stored depends uponthe storage capacity of the system RAM 11. Hence, it is possible tostore numerous sequence data as the system RAM 11 has a large storagecapacity. In FIG. 7, the system RAM 11 stores multiple sets of sequencedata, namely sequence data 1, sequence data 2, . . . , which correspondto different musical tunes respectively. Each sequence data containpairs of duration data and note data, which are consecutively arrangedat different addresses. In the sequence data 1, for example, durationdata 1 is arranged at address m, note data 1 is arranged at address m+1,duration data 2 is arranged at address m+2, and note data 2 is arrangedat address m+3. That is, duration data and note data are alternatelyarranged in sequence data.

The system CPU 10 manages how much the sequence data have been alreadytransferred to the music playback section 15. Transfer management ofsequence data is indicated by pointer 1, which moves (or scrolls) downalong with sequence data in FIG. 7. That is, the pointer 1 designatesthe last address of the sequence data that have been already transferredto the music playback section 15.

The system RAM 11 stores at least a minimum number of waveform data,which are designated by waveform numbers included in reproduced sequencedata. Sequence data of a single musical tune can designate maximallysixty-four kinds of waveform data (namely, sixty-four tone colors), sothat waveform number consists of six bits allowing selection from amongsixty four items. For this reason, as shown in FIG. 7, the system RAM 11stores sixty four waveform data, namely waveform data 1 to waveform data64. Waveform data are compressed to 4-bit samples by an ADPCM encoder.Two samples of compressed waveform data are stored at the same addressof the system RAM 11. A storage location of each address designates onebyte area (or 8-bit area), which is divided into two sections, namely afirst section ranging from LSB to fourth bit and a second sectionranging from fifth bit to MSB. At address n, for example, the firstsection stores a first sample of waveform data D1 while the secondsection stores a second sample of waveform data D2. Similarly, twosamples are stored in each of following addresses (e.g., address n+1).

The system CPU 10 also manages how much waveform data have been alreadytransferred to the music playback section 15. Transfer management ofwaveform data is indicated by pointers with respect to respectivechannels. That is, pointer 2 designates the last address of waveformdata that have been already transferred to the music playback section 15with respect to channel 1 (Ch-1). Similarly, pointer 3 designates thelast address of waveform data that have been already transferred to themusic playback section 15 with respect to channel 2 (Ch-2). In addition,pointer 4 designates the last address of waveform data transferred withrespect to channel 3 (Ch-3); and pointer 5 designates the last addressof waveform data transferred with respect to channel 4 (Ch-4). In thefirst embodiment using the ‘monophonic’ music playback section 15, thereis provided only one pointer for designating the last address ofwaveform data transferred with respect to a single channel. The systemRAM 11 of the portable telephone 1 shown in FIG. 1 is connected with theexternal device 20 via a communication line, so that it stores sequencedata and waveform data downloaded from the external device 20. Thesystem RAM 11 is not necessarily designed to store only the downloadeddata. Hence, it is required to store preset sequence data and waveformdata in advance in conformity with the aforementioned storage format.

In the second embodiment shown in FIG. 2, the music playback section 15comprises a CPU interface (CPU I/F) 130, first registers 131, a sequencedata FIFO memory 132, four waveform data FIFO memories 133 a-133 d, asequencer 134, second registers (REG) 135, a decoder 136 operating inTDM, a digital-to-analog converter (DAC) 137, a mixer 138, and an IRQcontrol section 139. Basically, the aforementioned parts of the musicplayback section of the second embodiment operate as similar toforegoing ones of the music playback section of the first embodimentshown in FIG. 3. The music playback section 15 of the second embodimentis characterized by providing four waveform data FIFO memories 133 a-133d, which operate to actualize simultaneous reproduction of musical tonesof four channels. Hereinafter, the music playback section 15 of thesecond embodiment will be described, particularly in connection withoperations of four memories for simultaneous reproduction of musicaltones of four channels.

Suppose that the system CPU 10 issues a playback start instruction tothe music playback section 15 shown in FIG. 4. In this case, thesequencer 134 starts playback upon detection of a playback startinstruction. The system CPU 10 issues a playback start instruction whenthe user operates a playback key of the portable telephone 1 (or 101) tostart playback of music or BGM, or when the portable telephone receivesan incoming call to start playback of incoming call melody. In addition,the system CPU 10 also issues a playback start instruction when the useroperates a hold key of the portable telephone to start playback of holdsound.

To start playback of music, the sequencer 134 accesses the sequence dataFIFO memory 132 to read sequence data consisting of duration data andnote data. Then, the sequencer 134 extracts waveform numbers that arecontained in the note data to designate waveform data, so that it writesthem together with channel numbers designating tone-generation channelsto the waveform number register within the first registers 131. Underthe control of the system CPU 10, each waveform data designated by eachwaveform number is written to one of four waveform data FIFO memories133 a-133 d, which is designated by the corresponding channel number.Next, a description will be given with respect to operations of themusic playback section 15 shown in FIG. 4 that deals with sequence datashown in FIG. 6B. In FIG. 6B, note data 1 is allocated to channel 1(Ch1) that is a tone-generation channel for generation of a musical noteof note data 1. Hence, note data 1 is written to the waveform data FIFOmemory 133 a of channel 1, so that a playback start preparation iscompleted with respect to note data 1. Thus, the sequencer 134 waits forthe start timing of note data 1 based on duration data 1, then, itcontrols the decoder 136 to start decoding on waveform data designatedby note data 1. Therefore, the decoder 136 starts decoding on waveformdata with respect to channel 1. Based on decoding results of waveformdata, the digital-to-analog converter 137 outputs analog musical tonesignals for channel 1. At the same time, the sequencer 134 reads thenext pair of duration data 2 and note data 2 from the sequence data FIFOmemory 132.

During decoding of waveform data designated by note data 1 in progress,when the amount of waveform data stored in the waveform data FIFO memory133 a of channel 1 decreases under the prescribed amount (e.g., 128bytes), the waveform data FIFO memory 133 a issues a waveform data IRQflag (W-IRQ), which is set to the status register within the firstregisters 131. At the same time, the waveform data IRQ flag is alsosupplied to the IRQ control section 139 to notify the system CPU 10 of ashortage event in which the waveform data FIFO memory 133 a runs shortof waveform data. Thus, the system CPU 10 supplies the next portion ofwaveform data for channel 1 to the waveform data FIFO memory 133 a byway of the waveform data register within the first registers 131. As aresult, even though the waveform data FIFO memory 133 a has a relativelysmall storage capacity, it is possible to reproduce numerous waveformdata, which are necessary for high-quality reproduction, withoutinterruption.

After reading duration data 2 and note data 2, the sequencer 134 writesa waveform number, which is contained in note data 2 to designatewaveform data, to the waveform number register together with a channelnumber designating channel 2, which is a tone-generation channel fornote data 2. Under the control of the system CPU 10, the designatedwaveform data is written to the waveform data FIFO memory 133 b ofchannel 2. Thus, the sequencer 134 waits for the start timing of notedata 2 based on duration data 2, then, it controls the decoder 136 tostart decoding on waveform data designated by note data 2. The decoder136 starts decoding on waveform data with respect to channel 2, so thatthe digital-to-analog converter 137 correspondingly outputs analogmusical tone signals for channel 2. At the same time, the sequencer 134reads the next pair of duration data 3 and note data 3 from the sequencedata FIFO memory 132.

Since the decoder 136 operates in TDM, it performs decoding on waveformdata of channel 1 and waveform data of channel 2 in TDM. Hence, thedecoder 136 outputs PCM waveform data for two channels in TDM. Thedigital-to-analog converter 137 converts PCM waveform data of twochannels to analog musical tone signals. Thus, the portable telephoneproduces polyphonic sounds based on the mixture of waveform data ofchannel 1 and channel 2.

After reading duration data 3 and note data 3, the sequencer 134 writesa waveform number, which is contained in note data 3 to designatewaveform data, to the waveform number register together with a channelnumber designating channel 3, which is a tone-generation channel fornote data 3. Under the control of the system CPU 10, the designatedwaveform data is written to the waveform data FIFO memory 133 c ofchannel 3. The sequencer 134 waits for the start timing of note data 3based on duration data 3. Before it comes to the start timing or notedata 3, the end timing of note data 1 based on gate time 1 arrives onthe sequencer 134. That is, the sequencer 134 stops the decoder 136decoding waveform data of channel 1, so that the music playback section15 stops producing sound of channel 1. At the same time, the sequencer134 sets a gate time END flag (GEND) to the status register within thefirst registers 131, and it also clears duration data 1 and note data 1in the sequence data FIFO memory 132.

Thereafter, when it comes to the start timing of note data 3 based onduration data 3, the sequencer 134 starts the decoder 136 to performdecoding on waveform data designated by note data 3. Thus, the decoder136 starts decoding on waveform data for channel 3, so that thedigital-to-analog converter 137 outputs analog musical tone signals forchannel 3. At the same time, the sequencer 134 reads the next pair ofduration data 4 and note data 4 (not shown) from the sequence data FIFOmemory 132; and then it repeats the aforementioned operations.

As described above, each of note data, contained in pairs of durationdata and note data of sequence data, is used to designate waveform dataand a tone-generation channel. During decoding of waveform datadesignated by note data in progress, when the amount of waveform datastored in the waveform data FIFO memory of the designatedtone-generation channel decreases under the prescribed amount (e.g., 128bytes), the waveform data FIFO memory issues a waveform data IRQ flag(W-IRQ), which is set to the status register within the first registers131. At the same time, the waveform data IRQ flag is also supplied tothe IRQ control section 139 to notify the system CPU 10 of a shortageevent in which the waveform data FIFO memory runs short of waveformdata. Thus, the system CPU 10 writes the next portion of waveform datato the waveform data FIFO memory by way of the waveform data registerwith respect to the designated tone-generation channel. As a result,even though the waveform data FIFO memories 133 a-133 d each have arelatively small storage capacity, it is possible to reproduce numerouswaveform data, which are necessary for high-quality reproduction,without interruption.

Due to progression of reproduction of waveform data based on sequencedata, when the amount of sequence data stored in the sequence data FIFOmemory 132 decreases under the prescribed amount (e.g., 8 bytes), thesequence data FIFO memory 132 issues a sequence data IRQ flag (S-IRQ),which is set to the status register within the first registers 131. Atthe same time, the sequence data IRQ flag is also supplied to the IRQcontrol section 139 to notify the system CPU 10 of a shortage event inwhich the sequence data FIFO memory 132 runs short of sequence data.Thus, the system CPU 10 writes the next portion of sequence data to thesequence data FIFO memory 132 by way of the sequence data register. As aresult, even though the sequence data FIFO memory 132 has a relativelysmall storage capacity, it is possible to reproduce numerous sequencedata, which are necessary for long-time reproduction, withoutinterruption.

The aforementioned reproduction processes are repeatedly performed tillan end of sequence data or until the user operates an end key of theportable telephone to stop playback. Until then, the portable telephonecontinuously reproduces sound of music based on sequence data.

When reproduced sound is used as music or incoming call sound (orincoming call melody), the speaker 23 produces reproduced sound. Whenreproduced sound is used as BGM or hold sound, it is mixed with receivedspeech signals from the speech processor 14 by the mixer 138, so thatthe speaker 22 produces mixtures of reproduced sound and receivedspeech. In the case of the hold sound, the mixer 138 mutes receivedspeech signals, hence, the speaker 22 produces only the hold sound asthe reproduced sound.

Next, descriptions will be given with respect to processes that areexecuted by the system CPU 10 to assist music playback processes of themusic playback section 15. FIG. 8 shows a main process for assisting themusic playback processes. First, the system CPU 10 proceeds to tuneselect operations that allow the user to select a musical tune (ormusical tunes) on the screen of the display 18 of the portable telephone1. There are provided four types of tune select operations for use indifferent purposes, namely a first tune select operation allows the userto select a musical tune for use in incoming call notification forproducing incoming call melody, a second tune select operation allowsthe user to select a musical tune for use in hold sound generationdesignated by the hold key, a third tune select operation allows theuser to select a musical tune for use in BGM playback for generating BGMmixed with received speech signals, and a fourth tune select operationallows the user to select a musical tune for use in music playback. Instep S1, a decision is made as to whether or not the user performs anyone of the aforementioned tune select operations. Therefore, the user isable to select musical tune numbers designating musical tunes for use indifferent purposes respectively. When the system CPU 10 detects in stepS1 that the user performs the tune select operation, the flow proceedsto step S2 in which the musical tune number selected for each of fouruses (namely, incoming call notification, hold sound generation, BGMplayback, and music playback) is stored in the system RAM 11. Then, theflow proceeds to step S3. When the system CPU 10 does not detect thatthe user performs the tune select operation, the flow proceeds directlyto step S3 by skipping step S2. In step S3, a decision is made as towhether or not playback is started. The start of playback is detectedwhen the user operates the playback key of the portable telephone tostart playback of BGM or music. In the case of the incoming callnotification, the start of playback is detected when the portabletelephone receives incoming call signals. In the case of the hold soundgeneration, the start of playback is detected when the user operates thehold key of the portable telephone.

When the start of playback is detected in step S3, the flow proceeds tostep S4 in which the system CPU 10 transfers a head portion of sequencedata to the music playback section 15. That is, the system CPU 10proceeds to transfer of sequence data in connection with a musical tunenumber that is selected by the user to cope with a specific use, namelyincoming call notification, hold sound generation, BGM playback or musicplayback. Firstly, the system CPU 10 transfers only several bytes of thehead portion of sequence data to the sequence data FIFO memory of themusic playback section 15. In step S5, the system CPU 10 performs asequencer start command transfer process to write sequencer startcommand data to the sequencer control register of the music playbacksection 15. By writing the sequencer start command data, the system CPU10 starts playback of a musical tune for use in a specific use, which isdetected in the foregoing step S3. If the system CPU 10 fails to detectthe start of playback with respect to any one of four uses in step S3,the flow skips steps S4 and S5.

In step S6, a decision is made as to whether or not playback is stopped.The stop of playback is detected when the user operates an end key ofthe portable telephone to stop playback of BGM or music. In the case ofthe incoming call notification, the stop of playback is detected whenthe user operates a conversation key of the portable telephone. In thecase of the hold sound generation, the stop of playback is detected whenthe user operates a hold release key of the portable telephone. If thesystem CPU 10 fails to detect the stop of playback with respect to anyone of four uses in step S6, the flow proceeds to step S7 in which thesystem CPU 10 performs a status register read process to read the dataof the status register of the music playback section 15 therein. In stepS8, a decision is made as to whether or not playback is completed onsequence data with reference to an END flag that is set to the statusregister and is read into the system CPU 10.

When the system CPU 10 detects that playback is completed on sequencedata because an END flag is set to the status register of the musicplayback section 15, the flow proceeds to step S9 in which the systemCPU 10 performs a sequencer stop command transfer process to writesequencer stop command data to the sequencer control register of themusic playback section 15. By writing the sequencer stop command data,the system CPU 10 stops operations of internal circuits of the musicplayback section 15. Therefore, the system CPU 10 clears various kindsof flags and data stored in the sequence data FIFO memory and waveformdata FIFO memory. If the system CPU 10 fails to detect that playback iscompleted on sequence data in step S8, it ends the main process.

If the stop of playback is detected in step S6, the flow proceedsdirectly to step S9 in which the system CPU 10 performs a sequencer stopcommand transfer process to write sequencer stop command data to thesequencer control register of the music playback section 15. Thus, thesystem CPU 10 stops playback processes of the music playback section 15to end the main process.

FIG. 9 shows an IRQ process that is executed by the system CPU 10 toassist music playback processes of the music playback section. That is,the system CPU 10 starts the IRQ process upon receipt of an IRQ signal(or IRQ flag).

Upon receipt of the IRQ signal, the flow proceeds to step S11 in whichthe system CPU 10 performs a status register read process to read thedata of the status register of the music playback section 15 therein. Instep S12, a decision is made as to whether or not a sequence data IRQflag is set to the status register. When the sequence data IRQ flag isset to the status register, it is possible to specify the cause of anIRQ as the shortage of sequence data in the sequence data FIFO memory.In step S13, the system CPU 10 performs a sequence data transfer processto transfer the prescribed amount of sequence data (e.g., 24 bytes) tothe sequence data FIFO memory of the music playback section 15. Then,the flow proceeds to step S14. When the system CPU 10 detects in stepS12 that the sequence data IRQ flag is not set to the status register,the flow directly proceeds to step S14 by skipping step S13.

In step S14, a decision is made as to whether or not a waveform data IRQflag is set to the status register. When the waveform data IRQ flag isset to the status register, it is possible to specify the cause of anIRQ as the shortage of waveform data in the waveform data FIFO memory.In step S15, a decision is made as to whether or not a gate time ENDflag GEND is set to the status register. When the system CPU 10 detectsin step S15 that the gate time END flag GEND is not set to the statusregister, the flow proceeds to step S16 in which a waveform datatransfer process is performed to transfer the prescribed amount ofwaveform data (e.g., 256 bytes) to the waveform data FIFO memory of themusic playback section 15 because the waveform data IRQ flag is set tothe status register and is detected in step S14. In order to specify the‘transferring’ waveform data, the system CPU 10 performs the waveformdata transfer process with reference to the content of the waveformnumber register of the music playback section 15.

When the system CPU 10 detects in step S15 that the gate time END flagis set to the status register, it immediately ends the IRQ process byskipping the waveform data transfer process of step S16 even though thewaveform data IRQ flag is set to the status register to indicate theshortage of waveform data in the waveform data FIFO memory. Because,when the gate time END flag is set to the status register by the end ofthe gate time (i.e., tone-generation period or note length), it isunnecessary to further reproduce waveform data, in other words, it isunnecessary to further transfer waveform data to the waveform data FIFOmemory. In addition, when the system CPU 10 detects in step S14 that thewaveform data IRQ flag is not set to the status register, it isunnecessary to perform the waveform data transfer process, so that thesystem CPU 10 immediately ends the IRQ process.

As described above, the music playback device of the present inventionexecutes music playback processes to play back selected musical tunes inconnection with four uses. That is, the music playback device plays backa musical tune as incoming call sound (or incoming call melody) when theportable telephone receives incoming call signals. The music playbackdevice plays back a musical tune as hold sound when the user operatesthe hold key of the portable telephone. The music playback device playsback a musical tune as BGM or music when the user operates the playbackkey of the portable telephone. In the aforementioned cases, the musicplayback device plays back musical tunes that are selected by the userto cope with four uses respectively. Herein, it is possible to selectdifferent musical tunes independently for four uses, namely incomingcall notification, hold sound generation, BGM playback, and musicplayback. Incidentally, the portable telephone allows the user toperform tune select operations at all times. Hence, the user is able toarbitrarily select musical tunes to be played back for four usesrespectively at any time.

Basically, processing of the system CPU 10 is mainly occupied by thetelephone function processes (which are not explained in conjunctionwith the drawings), while the aforementioned processes of FIGS. 8 and 9for assisting music playback processes require only a small load ofprocessing. Hence, even though music playback assisting processes areexecuted together with telephone function processes, it is unnecessaryto install a high-speed CPU in a portable telephone as the system CPU10.

The sequence data FIFO memory has a limited storage capacity for storingthirty-two byes of sequence data, which is merely an example and is notnecessarily a restrictive matter. That is, the portable telephonerequires the sequence data FIFO memory having a very small storagecapacity compared with the system RAM 11. In addition, the waveform dataFIFO memory has a limited storage capacity for storing 384 bytes ofwaveform data, which is merely an example and is not necessarily arestrictive matter. That is, the portable telephone requires thewaveform data FIFO memory having a very small storage capacity comparedwith the system RAM 11.

As described heretofore, this invention is not limited to theaforementioned embodiments, hence, it is possible to provide a varietyof modifications within the scope of the invention and without departingfrom the essential subject matter of the invention.

1. A musical tune playback device that performs musical tune playback ina portable telephone device incorporating a system control means, whichdoes not have musical tune playback functions but provides telephonefunction processing as a main process, comprising: an interface means; aread/write-enable musical tune data storage means for storing musicaltune data containing tone-generation data and tone-generation intervaldata, which are input thereto via the interface means, wherein theamount of musical tune data to be stored is limited; a read/write-enablewaveform data storage means for storing waveform data input thereto viathe interface means, wherein the amount of waveform data to be stored islimited; a monitor means for monitoring a vacant capacity of the musicaltune data storage means and a vacant capacity of the waveform datastorage means; a waveform reproduction means for reproducing andoutputting musical tone signals based on the waveform data, which areread from the waveform data storage means; and a performance controlmeans for reading the musical tune data stored in the musical tune datastorage means and for controlling the waveform reproduction means toreproduce the musical tone signals based on the read musical tune data,wherein when a prescribed size of a vacant area emerges in the musicaltune data storage means, the monitor means communicates a data transferrequest to the system control means, which in turn reads from a systemstorage means the following musical tune data, which are input via theinterface means and are stored in the vacant area of the musical tunedata storage means, and wherein when a prescribed size of a vacant areaemerges in the waveform data storage means, the monitor meanscommunicates a data transfer request to the system control means, whichin turn reads from the system storage means the following waveform data,which are input via the interface means and are stored in the vacantarea of the waveform data storage means.
 2. A musical tune playbackdevice according to claim 1, wherein when waveform data designated bywaveform designation data contained in the tone-generation data of themusical tune data, which are read from the musical tune data storagemeans, are not written into the waveform data storage means, the monitormeans communicates a data transfer request to the system control means,which in turn inputs via the interface means the waveform data, whichare read from the system storage means and are then written into thewaveform data storage means.
 3. A musical tune playback device accordingto claim 1, wherein upon reception of the data transfer request, thesystem control means refers to a flag status in the performance controlmeans to read the following musical tune data or the following waveformdata from the system storage means.
 4. A musical tune playback deviceaccording to claim 1, wherein the waveform data are compressed inadvance so that the waveform data read from the waveform data storagemeans are decoded in the waveform reproduction means to be expanded. 5.A portable telephone device having musical tune playback functions,which provides a system control means whose main process corresponds totelephone function processing, and a musical tune playback means forreproducing musical tone signals in cooperation with the system controlmeans, and which also provides a system storage means that is managed bythe system control means to store at least musical tune data andwaveform data, wherein said musical tune playback means comprises aninterface means, a read/write-enable musical tune data storage means forstoring musical tune data containing tone-generation data andtone-generation interval data, which are input thereto via the interfacemeans, wherein the amount of musical tune data to be stored is limited,a read/write-enable waveform data storage means for storing waveformdata input thereto via the interface means, wherein the amount ofwaveform data to be stored is limited, a monitor means for monitoring avacant capacity of the musical tune data storage means and a vacantcapacity of the waveform data storage means, a waveform reproductionmeans for reproducing and outputting musical tone signals based on thewaveform data, which are read from the waveform data storage means, anda performance control means for reading the musical tune data stored inthe musical tune data storage means and for controlling the waveformreproduction means to reproduce the musical tone signals based on theread musical tune data, wherein when a prescribed size of a vacant areaemerges in the musical tune data storage means, the monitor meanscommunicates a data transfer request to the system control means, whichin turn reads from the system storage means the following musical tunedata, which are input via the interface means and are stored in thevacant area of the musical tune data storage means, and wherein when aprescribed size of a vacant area emerges in the waveform data storagemeans, the monitor means communicates a data transfer request to thesystem control means, which in turn reads from the system storage meansthe following waveform data, which are input via the interface means andare stored in the vacant area of the waveform data storage means.
 6. Aportable telephone device having musical tune playback functionsaccording to claim 5, wherein with reference to waveform designationdata contained in the tone-generation data of the musical tune datastorage means, the system control means transfers to the musical tuneplayback means the designated waveform data, which are input via theinterface means and are written into the waveform data storage means. 7.A portable telephone device having musical tune playback functionsaccording to claim 5, wherein upon reception of the data transferrequest and with reference to a flag status in the performance controlmeans, the system control means makes a decision whether to read thefollowing musical tune data or the following waveform data from thesystem storage means.
 8. A portable telephone device having musical tuneplayback functions according to claim 5, wherein the waveform data arecompressed in advance so that the waveform data read from the waveformdata storage means are decoded in the waveform reproduction means to beexpanded.
 9. A portable telephone device having musical tune playbackfunctions according to claim 5, wherein the musical tune data and thewaveform data are respectively downloaded via communications and arestored in the system storage means.
 10. A portable telephone devicehaving musical tune playback functions according to claim 5, wherein thewaveform reproduction means is subjected to direct controls withoutintervention of the musical tune data storage means and the performancecontrol means, so that the waveform reproduction means reproducesmusical tone signals based on waveform reproduction parameters suppliedfrom the system control means.
 11. A portable telephone device havingmusical tune playback functions according to claim 5, wherein at an endof a gate time designated by the musical tune data, the system controlmeans makes preparation for reading the following waveform data from thesystem storage means.